package cn.itcast.controller;

import cn.itcast.pojo.Emp;
import cn.itcast.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("emp")
public class UserController {

    @Autowired
    private EmpService empService;

    @GetMapping("{id}")
    public Emp findEmpById(@PathVariable("id")int id) throws InterruptedException {
        Emp emp=empService.findEmpById(id);
        return emp;
    }
}
